package cate.common.table.activity.dungeonup;

import cate.common.table.ESheet;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class DURewardSheet extends ESheet<DURewardRow> {
    public final Map<Integer, Map<Integer, List<DURewardRow>>> groupReward = new HashMap<>();

    /**
     * 当row创建完之后
     */
    @Override
    protected void onRowCreated(DURewardRow row) {
        Map<Integer, List<DURewardRow>> groupMap = groupReward.computeIfAbsent(row.group, k -> new HashMap<>());
        List<DURewardRow> list = groupMap.computeIfAbsent(row.type, k -> new LinkedList<>());
        list.add(row);
    }

    @Override
    protected DURewardRow buildRow() {
        return new DURewardRow();
    }

    @Override
    public String getSheetName() {
        return "卡牌奖励池";
    }
}
